Let's start by
introducing you to or refreshing your
knowledge of containers. you might be familiar with
container technology, but in case you're not,
here's a quick review. Let's start with the structure
of a container image. Container images is a package with your application in it, along with everything your
application needs to run. For example, in a container image for
a Java replication, replication is
packaged together with the appropriate Java
virtual machine. That might still
sound a bit abstract, so let's zoom in a bit further. This is what you'll see
inside every container. An archive with files which includes everything our
application needs to run. This includes system Libraries, executable programs,
and resources such as, but not limited to, HTML files, images, binary blobs, and your
application source files. A container image can contain programs written in any
programming language. For example, Java,
Python, JavaScript, PHP, or Go, and can include any binary
dependency you need. Later in this course,
we'll look at some practical examples of applications using
those runtimes. Let's talk about what happens when you run a container image. Running a container
image means you are executing one of the programs
inside the container image. For example, if your
container image contains a Java application, the program you execute is
the Java Virtual Machine. As we've seen, the
container image is an archive with files. This packaging
turns your code and resources into something
you can store, download, and send
somewhere else. A container represents the running processes
of your application. It only exists at runtime. If they're no running processes, there is no container. Two other relevant things
happen when a container runs. First, the contents of
the container image are used to see the private file
system for the container. These are all files of the processes of your
applications see. Second, the processes
in the container have access to a virtual network
interface with a local IP. Your application can bind
to this interface and start listening on a port
for incoming traffic. A process running in a
container has access to its own private
virtual network stack. Your application can always open a port and listen for
incoming connections. Cloud Run expects your
container to listen on port number 8080 to
handle web requests. The port number 8080 is
a configurable default. If port 8080 is unavailable
to your application, you can change the
application's configuration to use a different port. You don't need to
provide an HTTPS server because Google's infrastructure
handles that for you. Before we move on, here are the four things you need to
remember from this review. A container image is
an archive with files. It includes executables,
system libraries, data files, and more. A container is a running
container image. It represents the running
processes of your container. A container image
is self-contained. Everything that your
application needs to run is inside the
container image. If your application is a Node.js application, for example, your source files
are in the image along with the Node.js runtime. Cloud Run, expect
your application to handle web requests. You don't need to
provide an HTTPS server because Cloud Run
handles that for you. In a later module, we'll dive deeper into container
technology. You'll learn about
several ways to package your application in
a container image, such as with docker or by using alternative
packaging options.